package com.hxzy.shop.marketing.controller;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.common.dto.marketing.PageRequest;
import com.hxzy.shop.common.dto.marketing.req.AddImageReq;
import com.hxzy.shop.entity.DistributorImage;
import com.hxzy.shop.marketing.service.DistributorImageService;
import com.hxzy.shop.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ Author     ：dididi
 * @ Date       ：Created in 16:25 2023/8/10
 * @ Modified By：
 */
@RestController
@Api(value = "分销推广")
@RequestMapping(value = "/distribute")
public class DistributionImageController {

    @Resource
    private DistributorImageService distributorImageService;
    @PostMapping(value = "/imageList")
    @ApiOperation(value = "分销推广图列表")
    public Result<PageInfo<DistributorImage>> imageList(@RequestBody PageRequest req){
        return Result.success(this.distributorImageService.imageList(req));
    }

    @PostMapping(value = "/addImage")
    @ApiOperation(value = "新增分销推广图片")
    Result<Object> addImage(@RequestBody AddImageReq req){
        return Result.success(this.distributorImageService.addImage(req));
    }
}
